package IO;

import java.io.*;

/**
 * 理解操作步骤
 * 1.创建源
 * 2.创建流
 * 3.操作
 * 4.释放资源
 */
public class io_test01 {
    public static void main(String[] args) {
        //创建源
        File src = new File("src/IO/abc.txt");
        //选择流
        try {
            InputStream is = new FileInputStream(src);
            //操作(读)
            int data1 = is.read();//a
            int data2 = is.read();//b
            int data3 = is.read();//c

            System.out.println((char)data1);
            System.out.println((char) data2);
            System.out.println((char)data3);
            //释放资源
            is.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
